//
//  QLMBaoyangDeviceTabCell.m
//  Xiaomakuaixiu
//
//  Created by 龚碧容 on 2017/10/30.
//  Copyright © 2017年 hwd. All rights reserved.
//

#import "QLMBaoyangDeviceTabCell.h"

@implementation QLMBaoyangDeviceTabCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
- (IBAction)addDeviceAction:(UIButton *)sender {
    [_delegate  addBaoyangDeviceAction];
}

- (void)_creatMainUI{
    
    self.trodecriptionTextView.layer.masksToBounds=YES;
    self.trodecriptionTextView.layer.cornerRadius=5;
    self.trodecriptionTextView.backgroundColor=[UIColor clearColor];
    
    self.trodecriptionTextView.placeholderColor=[UIColor lightGrayColor];
    self.trodecriptionTextView.placeholder=@"请详细描述保养说明（1-50字）";
    
    NSArray *titlArr=[NSArray arrayWithObjects:@"设备 *",@"保养说明 *",nil];
    for (int i=0; i<2; i++) {
        UILabel *aTipLabel=[[UILabel alloc] initWithFrame:CGRectMake(20, 10+50*i, 70, 30)];
        aTipLabel.font=[UIFont systemFontOfSize:14];
        aTipLabel.textColor=[UIColor darkGrayColor];
        
        NSString *telStr=[NSString stringWithFormat:@"%@",titlArr[i]];
        NSMutableAttributedString *aString=[[NSMutableAttributedString alloc] initWithString:telStr];
        [aString addAttribute:NSForegroundColorAttributeName value:[UIColor redColor] range:NSMakeRange(telStr.length-2, 2)];
        aTipLabel.attributedText=aString;
        
        aTipLabel.backgroundColor=[UIColor clearColor];
        aTipLabel.textAlignment=NSTextAlignmentLeft;
        [self addSubview:aTipLabel];
        
        UIView *line2=[[UIView alloc] initWithFrame:CGRectMake(17, 49.5+100*i, kScreen_width-17, 0.5)];
        line2.backgroundColor=[UIColor lightGrayColor];
        [self addSubview:line2];
    }
}

+ (instancetype)cellWithTableView:(UITableView *)tableView{
    
    static NSString *identifiew=@"QLMBaoyangDeviceTabCellId";
    QLMBaoyangDeviceTabCell *cell=[tableView dequeueReusableCellWithIdentifier:identifiew];
    if (cell==nil) {
        cell=[[[NSBundle mainBundle] loadNibNamed:@"QLMBaoyangDeviceTabCell" owner:nil options:nil] firstObject];
    }
    return cell;
}

@end
